<template>
  <view class="component-page">
    <!-- 1. 容器组件分组 -->
    <view class="section">
      <view class="section-title">1. 容器</view>
      <view class="section-item">view视图</view>
    </view>

    <!-- 2. 基础内容分组 -->
    <view class="section">
      <view class="section-title">2. 基础内容</view>
      <view class="section-item">text文本编辑</view>
      <view class="section-item">icon图标</view>
    </view>

    <!-- 3. 表单组件分组 -->
    <view class="section">
      <view class="section-title">3. 表单组件</view>
      <view class="section-item">button按钮</view>
      <view class="section-item">checkbox多选框</view>
      <view class="section-item">label标签组件</view>
      <view class="section-item">input输入框</view>
      <view class="section-item">textarea多行文本输入框</view>
      <view class="section-item">form表单</view>
    </view>

    <!-- 4. 导航组件分组 -->
    <view class="section">
      <view class="section-title">4. 导航组件</view>
      <view class="section-item">navigator</view>
    </view>

    <!-- 底部TabBar（模拟选中“组件”） -->
    <view class="tab-bar">
      <view class="tab-item active">组件</view>
      <view class="tab-item">语法</view>
      <view class="tab-item">API</view>
      <view class="tab-item">案例</view>
    </view>
  </view>
</template>

<script>
export default {
  name: "ComponentPage"
};
</script>

<style scoped>
.component-page {
  background-color: #fff;
  min-height: 100vh;
}

.section {
  margin-bottom: 1px; /* 分组之间的细分隔线 */
}

.section-title {
  background-color: #c0e8c0; /* 浅绿色背景 */
  padding: 8px 16px;
  font-weight: bold;
}

.section-item {
  padding: 8px 16px;
  border-bottom: 1px solid #eee;
}

/* 底部TabBar样式 */
.tab-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  border-top: 1px solid #eee;
  background-color: #fff;
  align-items: center;
  justify-content: space-around;
}

.tab-item {
  text-align: center;
}

.tab-item.active {
  color: #007aff; /* 选中项的颜色 */
}
</style>